//
//  main.m
//  oc_分文件创建类
//
//  Created by blue on 16/4/8.
//  Copyright (c) 2016年 zzn. All rights reserved.
//

/*
 #import导入头文件：
 #import <> 用于导入系统定义头文件
 #import "" 用于导入自定义的头文件
 */

#import "Worker.h"
#import <Foundation/Foundation.h>


int main(int argc, const char * argv[]) {
    @autoreleasepool {
        
        Worker *w1=[[Worker alloc]init];
        NSLog(@"姓名:%@,ID号:%@,工资:%g",w1.name,w1.cid,
             w1.salary);
        //输出：张三 092480234 4500
        
        
        //Worker *w2=[[Worker alloc]initWithName:@"李四"];
        //w2.cid =@"9287412234123";
        
        Worker *w2=[[Worker alloc]init];
        [w2 setCid:@"9287412234123"];
        w2.salary = 4800;
        NSLog(@"姓名:%@,ID号:%@,工资:%g",w2.name,w2.cid,
              w2.salary);
        //输出： 李四  9287412234123 4800
        
        
        
//        [w1 setName:@"张三"];
//        [w1 setCid:@"1092429479847"];
//        [w1 setSalary:5000];
     
      /*  [w1 setName:@"张三" andCid:@"847928347198" andSalary:5000];
        */
       /* NSLog(@"姓名:%@,ID号:%@,工资:%g",[w1 name],[w1 cid],
              [w1 salary]);*/
        
        /*类的实例变量也可以用.访问
         必须给此实例变量定义setter、getter方法
         */
        
       // w1.salary =4000;
        
        
    }
    return 0;
}
